#!/usr/bin/env python2
#-*-coding=utf-8-*-

def greatest_common_divisor(num1, num2):
    while num2 != 0:
        z = num1 % num2
        num1 = num2
        num2 = z
    return num1
if __name__ == '__main__':
    num1 = float(raw_input('第一个数：'))
    num2 = float(raw_input('第二个数：'))
    gcd = greatest_common_divisor(num1, num2)
    print '最大公约数为：%d. 最小公倍数为：%d.' % (gcd, num1*num2/gcd)
